{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "[10.169226016840172, 10.169226016840172, 1.6207827931238674]"
      ]
     },
     "execution_count": 8,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "z = [10, 10, 100]\n",
    "total_frequency = np.sum(z)\n",
    "class_weights = []\n",
    "for frequency in z:\n",
    "    class_weight = 1 / (np.log(1.02 + (frequency / total_frequency)))\n",
    "    class_weights.append(class_weight)\n",
    "class_weights"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 18,
   "metadata": {},
   "outputs": [],
   "source": [
    "x = np.arange(0,1000)\n",
    "t = np.sum(x)\n",
    "y = [1 / (np.log(1.02 + (one / t))) for one in x]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 19,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "<matplotlib.collections.PathCollection at 0x7f35701f10f0>"
      ]
     },
     "execution_count": 19,
     "metadata": {},
     "output_type": "execute_result"
    },
    {
     "data": {
      "image/png": "iVBORw0KGgoAAAANSUhEUgAAAXAAAAD4CAYAAAD1jb0+AAAABHNCSVQICAgIfAhkiAAAAAlwSFlzAAALEgAACxIB0t1+/AAAADh0RVh0U29mdHdhcmUAbWF0cGxvdGxpYiB2ZXJzaW9uMy4xLjMsIGh0dHA6Ly9tYXRwbG90bGliLm9yZy+AADFEAAAUsklEQVR4nO3df6xX9X3H8dcLqJg5rVLBWLC7YtnapiI0N0XKljk6nBNjWdr6I9i5rYVkWVZtlzoZJsRFUpY0li1ZuqprZwZTs9ZShx0d0S5ZidB9b6HgRiuyUqp2cBu6QkwKFd7743u+cqUX7vf8+n7POd/nIyHc77nncD+HQ1558zmfH44IAQDqZ1K/GwAAyIYAB4CaIsABoKYIcACoKQIcAGpqSi9/2KWXXhpDQ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Byfq0qs4j4X0k/tP1ryaH3S/pvNfg5q911cq3tX0r+nXfuubHPeYy0z/Xrkq63fUnyP5frk2Pd6fdLgC5fFNwo6QVJ+yWt7nd7CrqnX1f7v0q7Je1Kft2odt/fM5L2Jb9PS8632qNx9kvao/Yb/r7fR477v07S5uTr2ZK+JelFSf8saWpy/Pzk84vJ92f3u90Z73WepFbyrDdJuqTpz1nS/ZK+K+l5Sf8oaWrTnrOkx9Tu4/+52pX0R7M8V0l/lNz7i5L+ME0bmEoPADVVhy4UAMA4CHAAqCkCHABqigAHgJoiwAGgpghwAKgpAhwAaur/AWFYr82MCT2qAAAAAElFTkSuQmCC\n",
      "text/plain": [
       "<Figure size 432x288 with 1 Axes>"
      ]
     },
     "metadata": {
      "needs_background": "light"
     },
     "output_type": "display_data"
    }
   ],
   "source": [
    "import matplotlib.pyplot as plt\n",
    "plt.scatter(x, y)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 24,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "numpy.ndarray"
      ]
     },
     "execution_count": 24,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "weight = np.load('../TableGenerations/dataset04/tables_classes_weights.npy')\n",
    "type(weight)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "pytorch-py3",
   "language": "python",
   "name": "pytorch-py3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.6.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
